home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / SpeechRecognition.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  26.2 KB  |  757 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        SpeechRecognition.a
  3. ;
  4. ;    Contains:    Apple Speech Recognition Toolbox Interfaces.
  5. ;
  6. ;    Version:    Technology:    PlainTalk 1.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__SPEECHRECOGNITION__') = 'UNDEFINED' THEN
  18. __SPEECHRECOGNITION__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  24.     include 'MixedMode.a'
  25.     ENDIF
  26.  
  27. ;  Error Codes [Speech recognition gets -5100 through -5199] 
  28.  
  29. kSRNotAvailable                    EQU        -5100                ; the service requested is not avail or applicable 
  30. kSRInternalError                EQU        -5101                ; a system internal or hardware error condition 
  31. kSRComponentNotFound            EQU        -5102                ; a needed system resource was not located 
  32. kSROutOfMemory                    EQU        -5103                ; an out of memory error occurred in the toolbox memory space 
  33. kSRNotASpeechObject                EQU        -5104                ; the object specified is no longer or never was valid 
  34. kSRBadParameter                    EQU        -5105                ; an invalid parameter was specified 
  35. kSRParamOutOfRange                EQU        -5106                ; when we say 0-100, don't pass in 101. 
  36. kSRBadSelector                    EQU        -5107                ; an unrecognized selector was specified 
  37. kSRBufferTooSmall                EQU        -5108                ; returned from attribute access functions 
  38. kSRNotARecSystem                EQU        -5109                ; the object used was not a SRRecognitionSystem 
  39. kSRFeedbackNotAvail                EQU        -5110                ; there is no feedback window associated with SRRecognizer 
  40. kSRCantSetProperty                EQU        -5111                ; a non-settable property was specified 
  41. kSRCantGetProperty                EQU        -5112                ; a non-gettable property was specified 
  42. kSRCantSetDuringRecognition        EQU        -5113                ; the property can't be set while recognition is in progress -- do before or between utterances. 
  43. kSRAlreadyListening                EQU        -5114                ; in response to SRStartListening 
  44. kSRNotListeningState            EQU        -5115                ; in response to SRStopListening 
  45. kSRModelMismatch                EQU        -5116                ; no acoustical models are avail to match request 
  46. kSRNoClientLanguageModel        EQU        -5117                ; trying to access a non-specified SRLanguageModel 
  47. kSRNoPendingUtterances            EQU        -5118                ; nothing to continue search on 
  48. kSRRecognitionCanceled            EQU        -5119                ; an abort error occurred during search 
  49. kSRRecognitionDone                EQU        -5120                ; search has finished, but nothing was recognized 
  50. kSROtherRecAlreadyModal            EQU        -5121                ; another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now 
  51. kSRHasNoSubItems                EQU        -5122                ; SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. 
  52. kSRSubItemNotFound                EQU        -5123                ; returned when accessing a non-existent sub item of a container 
  53. kSRLanguageModelTooBig            EQU        -5124                ; Cant build language models so big 
  54. kSRAlreadyReleased                EQU        -5125                ; this object has already been released before 
  55. kSRAlreadyFinished                EQU        -5126                ; the language model can't be finished twice 
  56. kSRWordNotFound                    EQU        -5127                ; the spelling couldn't be found in lookup(s) 
  57. kSRNotFinishedWithRejection        EQU        -5128                ; property not found because the LMObj is not finished with rejection 
  58. kSRExpansionTooDeep                EQU        -5129                ; Language model is left recursive or is embedded too many levels 
  59. kSRTooManyElements                EQU        -5130                ; Too many elements added to phrase or path or other langauge model object 
  60. kSRCantAdd                        EQU        -5131                ; Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    
  61. kSRSndInSourceDisconnected        EQU        -5132                ; Sound input source is disconnected 
  62. kSRCantReadLanguageObject        EQU        -5133                ; An error while trying to create new Language object from file or pointer -- possibly bad format 
  63.                                                             ; non-release debugging error codes are included here 
  64. kSRNotImplementedYet            EQU        -5199                ; you'd better wait for this feature in a future release 
  65.  
  66. ;  Type Definitions 
  67.  
  68.  
  69. ; typedef SRSpeechObject                 SRRecognitionSystem
  70.  
  71. ; typedef SRSpeechObject                 SRRecognizer
  72.  
  73. ; typedef SRSpeechObject                 SRSpeechSource
  74.  
  75. ; typedef SRSpeechSource                 SRRecognitionResult
  76.  
  77. ; typedef SRSpeechObject                 SRLanguageObject
  78.  
  79. ; typedef SRLanguageObject                 SRLanguageModel
  80.  
  81. ; typedef SRLanguageObject                 SRPath
  82.  
  83. ; typedef SRLanguageObject                 SRPhrase
  84.  
  85. ; typedef SRLanguageObject                 SRWord
  86.  
  87. ;  between 0 and 100 
  88. ; typedef unsigned short                 SRSpeedSetting
  89.  
  90. ;  between 0 and 100 
  91. ; typedef unsigned short                 SRRejectionLevel
  92.  
  93. ;  When an event occurs, the user supplied proc will be called with a pointer    
  94. ;     to the param passed in and a flag to indicate conditions such                
  95. ;     as interrupt time or system background time.                                
  96. SRCallBackStruct        RECORD 0
  97. what                     ds.l    1                ; offset: $0 (0)        ;  one of notification flags 
  98. message                     ds.l    1                ; offset: $4 (4)        ;  contains SRRecognitionResult id 
  99. instance                 ds.l    1                ; offset: $8 (8)        ;  ID of recognizer being notified 
  100. status                     ds.w    1                ; offset: $C (12)        ;  result status of last search 
  101. flags                     ds.w    1                ; offset: $E (14)        ;  non-zero if occurs during interrupt 
  102. refCon                     ds.l    1                ; offset: $10 (16)        ;  user defined - set from SRCallBackParam 
  103. sizeof                     EQU *                    ; size:   $14 (20)
  104.                         ENDR
  105. ;  Call back procedure definition 
  106. SRCallBackParam            RECORD 0
  107. callBack                 ds.l    1                ; offset: $0 (0)
  108. refCon                     ds.l    1                ; offset: $4 (4)
  109. sizeof                     EQU *                    ; size:   $8 (8)
  110.                         ENDR
  111. ;  Recognition System Types 
  112.  
  113. kSRDefaultRecognitionSystemID    EQU        0
  114. ;  Recognition System Properties 
  115.  
  116. kSRFeedbackAndListeningModes    EQU        'fbwn'                ; short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes 
  117. kSRRejectedWord                    EQU        'rejq'                ; the SRWord used to represent a rejection 
  118. kSRCleanupOnClientExit            EQU        'clup'                ; Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits 
  119.  
  120. kSRNoFeedbackNoListenModes        EQU        0                    ; next allocated recognizer has no feedback window and doesn't use listening modes    
  121. kSRHasFeedbackHasListenModes    EQU        1                    ; next allocated recognizer has feedback window and uses listening modes             
  122. kSRNoFeedbackHasListenModes        EQU        2                    ; next allocated recognizer has no feedback window but does use listening modes     
  123. ;  Speech Source Types 
  124.  
  125. kSRDefaultSpeechSource            EQU        0
  126. kSRLiveDesktopSpeechSource        EQU        'dklv'                ; live desktop sound input 
  127. kSRCanned22kHzSpeechSource        EQU        'ca22'                ; AIFF file based 16 bit, 22.050 KHz sound input 
  128. ;  Notification via Apple Event or Callback 
  129. ;  Notification Flags 
  130.  
  131. kSRNotifyRecognitionBeginning    EQU        $00000001            ; recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition 
  132. kSRNotifyRecognitionDone        EQU        $00000002            ; recognition has terminated. result (if any) is available. 
  133. ;  Apple Event selectors 
  134. ;  AppleEvent message class  
  135.  
  136. kAESpeechSuite                    EQU        'sprc'
  137. ;  AppleEvent message event ids 
  138.  
  139. kAESpeechDone                    EQU        'srsd'
  140. kAESpeechDetected                EQU        'srbd'
  141. ;  AppleEvent Parameter ids 
  142.  
  143. keySRRecognizer                    EQU        'krec'
  144. keySRSpeechResult                EQU        'kspr'
  145. keySRSpeechStatus                EQU        'ksst'
  146. ;  AppleEvent Parameter types 
  147.  
  148. typeSRRecognizer                EQU        'trec'
  149. typeSRSpeechResult                EQU        'tspr'
  150.  
  151. ;  SRRecognizer Properties 
  152.  
  153. kSRNotificationParam            EQU        'noti'                ; see notification flags below 
  154. kSRCallBackParam                EQU        'call'                ; type SRCallBackParam 
  155. kSRSearchStatusParam            EQU        'stat'                ; see status flags below 
  156. kSRAutoFinishingParam            EQU        'afin'                ; automatic finishing applied on LM for search 
  157. kSRForegroundOnly                EQU        'fgon'                ; Boolean. Default is true. If true, client recognizer only active when in foreground.    
  158. kSRBlockBackground                EQU        'blbg'                ; Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    
  159. kSRBlockModally                    EQU        'blmd'                ; Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! 
  160. kSRWantsResultTextDrawn            EQU        'txfb'                ; Boolean. Default is true. If true, search results are posted to Feedback window 
  161. kSRWantsAutoFBGestures            EQU        'dfbr'                ; Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior 
  162. kSRSoundInVolume                EQU        'volu'                ; short in [0..100] log scaled sound input power. Can't set this property 
  163. kSRReadAudioFSSpec                EQU        'aurd'                ; *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF 
  164. kSRCancelOnSoundOut                EQU        'caso'                ; Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. 
  165. kSRSpeedVsAccuracyParam            EQU        'sped'                ; SRSpeedSetting between 0 and 100 
  166. ;  0 means more accurate but slower. 
  167. ;  100 means (much) less accurate but faster. 
  168.  
  169. kSRUseToggleListen                EQU        0                    ; listen key modes 
  170. kSRUsePushToTalk                EQU        1
  171.  
  172. kSRListenKeyMode                EQU        'lkmd'                ; short: either kSRUseToggleListen or kSRUsePushToTalk 
  173. kSRListenKeyCombo                EQU        'lkey'                ; short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message 
  174. kSRListenKeyName                EQU        'lnam'                ; Str63: string representing ListenKeyCombo 
  175. kSRKeyWord                        EQU        'kwrd'                ; Str255: keyword preceding spoken commands in kSRUseToggleListen mode 
  176. kSRKeyExpected                    EQU        'kexp'                ; Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? 
  177. ;  Operational Status Flags 
  178.  
  179. kSRIdleRecognizer                EQU        $00000001            ; engine is not active 
  180. kSRSearchInProgress                EQU        $00000002            ; search is in progress 
  181. kSRSearchWaitForAllClients        EQU        $00000004            ; search is suspended waiting on all clients' input 
  182. kSRMustCancelSearch                EQU        $00000008            ; something has occurred (sound played, non-speech detected) requiring the search to abort 
  183. kSRPendingSearch                EQU        $00000010            ; we're about to start searching 
  184. ;  Recognition Result Properties 
  185.  
  186. kSRTEXTFormat                    EQU        'TEXT'                ; raw text in user supplied memory 
  187. kSRPhraseFormat                    EQU        'lmph'                ; SRPhrase containing result words 
  188. kSRPathFormat                    EQU        'lmpt'                ; SRPath containing result phrases or words 
  189. kSRLanguageModelFormat            EQU        'lmfm'                ; top level SRLanguageModel for post parse 
  190. ;  SRLanguageObject Family Properties 
  191.  
  192. kSRSpelling                        EQU        'spel'                ; spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel 
  193. kSRLMObjType                    EQU        'lmtp'                ; Returns one of SRLanguageObject Types listed below 
  194. kSRRefCon                        EQU        'refc'                ; 4 bytes of user storage 
  195. kSROptional                        EQU        'optl'                ; Boolean -- true if SRLanguageObject is optional    
  196. kSREnabled                        EQU        'enbl'                ; Boolean -- true if SRLanguageObject enabled 
  197. kSRRepeatable                    EQU        'rptb'                ; Boolean -- true if SRLanguageObject is repeatable 
  198. kSRRejectable                    EQU        'rjbl'                ; Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord 
  199.                                                             ;        object can be returned in place of SRLanguageObject with this property)    
  200. kSRRejectionLevel                EQU        'rjct'                ; SRRejectionLevel between 0 and 100 
  201. ;  LM Object Types -- returned as kSRLMObjType property of language model objects 
  202.  
  203. kSRLanguageModelType            EQU        'lmob'                ; SRLanguageModel 
  204. kSRPathType                        EQU        'path'                ; SRPath 
  205. kSRPhraseType                    EQU        'phra'                ; SRPhrase 
  206. kSRWordType                        EQU        'word'                ; SRWord 
  207. ;  a normal and reasonable rejection level 
  208.  
  209. kSRDefaultRejectionLevel        EQU        50
  210. ; *******************************************************************************
  211. ;                         NOTES ON USING THE API                                    
  212. ;                                                                                 
  213. ;         All operations (with the exception of SRGetRecognitionSystem) are        
  214. ;         directed toward an object allocated or begot from New, Get and Read        
  215. ;         type calls.                                                                
  216. ;                                                                                 
  217. ;         There is a simple rule in dealing with allocation and disposal:            
  218. ;                                                                                 
  219. ;         *    all toolbox allocations are obtained from a SRRecognitionSystem        
  220. ;                                                                                 
  221. ;         *    if you obtain an object via New or Get, then you own a reference     
  222. ;             to that object and it must be released via SRReleaseObject when        
  223. ;             you no longer need it                                                
  224. ;                                                                                 
  225. ;         *    when you receive a SRRecognitionResult object via AppleEvent or        
  226. ;             callback, it has essentially been created on your behalf and so        
  227. ;             you are responsible for releasing it as above                        
  228. ;                                                                                 
  229. ;         *    when you close a SRRecognitionSystem, all remaining objects which        
  230. ;             were allocated with it will be forcefully released and any            
  231. ;             remaining references to those objects will be invalid.                
  232. ;                                                                                 
  233. ;         This translates into a very simple guideline:                            
  234. ;             If you allocate it or have it allocated for you, you must release    
  235. ;             it.  If you are only peeking at it, then don't release it.            
  236. ;                                                                                 
  237. ; *******************************************************************************
  238. ;  Opening and Closing of the SRRecognitionSystem 
  239. ;
  240. ; pascal OSErr SROpenRecognitionSystem(SRRecognitionSystem *system, OSType systemID)
  241. ;
  242.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  243.         Macro
  244.         _SROpenRecognitionSystem
  245.             move.w              #$0400,D0
  246.             dc.w                $AA56
  247.         EndM
  248.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  249.         IMPORT_CFM_FUNCTION SROpenRecognitionSystem
  250.     ENDIF
  251.  
  252. ;
  253. ; pascal OSErr SRCloseRecognitionSystem(SRRecognitionSystem system)
  254. ;
  255.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  256.         Macro
  257.         _SRCloseRecognitionSystem
  258.             move.w              #$0201,D0
  259.             dc.w                $AA56
  260.         EndM
  261.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  262.         IMPORT_CFM_FUNCTION SRCloseRecognitionSystem
  263.     ENDIF
  264.  
  265. ;  Accessing Properties of any Speech Object 
  266. ;
  267. ; pascal OSErr SRSetProperty(SRSpeechObject srObject, OSType selector, const void *property, Size propertyLen)
  268. ;
  269.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  270.         Macro
  271.         _SRSetProperty
  272.             move.w              #$0802,D0
  273.             dc.w                $AA56
  274.         EndM
  275.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  276.         IMPORT_CFM_FUNCTION SRSetProperty
  277.     ENDIF
  278.  
  279. ;
  280. ; pascal OSErr SRGetProperty(SRSpeechObject srObject, OSType selector, void *property, Size *propertyLen)
  281. ;
  282.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  283.         Macro
  284.         _SRGetProperty
  285.             move.w              #$0803,D0
  286.             dc.w                $AA56
  287.         EndM
  288.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  289.         IMPORT_CFM_FUNCTION SRGetProperty
  290.     ENDIF
  291.  
  292. ;  Any object obtained via New or Get type calls must be released 
  293. ;
  294. ; pascal OSErr SRReleaseObject(SRSpeechObject srObject)
  295. ;
  296.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  297.         Macro
  298.         _SRReleaseObject
  299.             move.w              #$0204,D0
  300.             dc.w                $AA56
  301.         EndM
  302.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  303.         IMPORT_CFM_FUNCTION SRReleaseObject
  304.     ENDIF
  305.  
  306. ;
  307. ; pascal OSErr SRGetReference(SRSpeechObject srObject, SRSpeechObject *newObjectRef)
  308. ;
  309.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  310.         Macro
  311.         _SRGetReference
  312.             move.w              #$0425,D0
  313.             dc.w                $AA56
  314.         EndM
  315.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  316.         IMPORT_CFM_FUNCTION SRGetReference
  317.     ENDIF
  318.  
  319. ;  SRRecognizer Instance Functions 
  320. ;
  321. ; pascal OSErr SRNewRecognizer(SRRecognitionSystem system, SRRecognizer *recognizer, OSType sourceID)
  322. ;
  323.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  324.         Macro
  325.         _SRNewRecognizer
  326.             move.w              #$060A,D0
  327.             dc.w                $AA56
  328.         EndM
  329.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  330.         IMPORT_CFM_FUNCTION SRNewRecognizer
  331.     ENDIF
  332.  
  333. ;
  334. ; pascal OSErr SRStartListening(SRRecognizer recognizer)
  335. ;
  336.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  337.         Macro
  338.         _SRStartListening
  339.             move.w              #$020C,D0
  340.             dc.w                $AA56
  341.         EndM
  342.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  343.         IMPORT_CFM_FUNCTION SRStartListening
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal OSErr SRStopListening(SRRecognizer recognizer)
  348. ;
  349.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  350.         Macro
  351.         _SRStopListening
  352.             move.w              #$020D,D0
  353.             dc.w                $AA56
  354.         EndM
  355.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  356.         IMPORT_CFM_FUNCTION SRStopListening
  357.     ENDIF
  358.  
  359. ;
  360. ; pascal OSErr SRSetLanguageModel(SRRecognizer recognizer, SRLanguageModel languageModel)
  361. ;
  362.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  363.         Macro
  364.         _SRSetLanguageModel
  365.             move.w              #$040E,D0
  366.             dc.w                $AA56
  367.         EndM
  368.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  369.         IMPORT_CFM_FUNCTION SRSetLanguageModel
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal OSErr SRGetLanguageModel(SRRecognizer recognizer, SRLanguageModel *languageModel)
  374. ;
  375.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  376.         Macro
  377.         _SRGetLanguageModel
  378.             move.w              #$040F,D0
  379.             dc.w                $AA56
  380.         EndM
  381.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  382.         IMPORT_CFM_FUNCTION SRGetLanguageModel
  383.     ENDIF
  384.  
  385. ;
  386. ; pascal OSErr SRContinueRecognition(SRRecognizer recognizer)
  387. ;
  388.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  389.         Macro
  390.         _SRContinueRecognition
  391.             move.w              #$0210,D0
  392.             dc.w                $AA56
  393.         EndM
  394.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  395.         IMPORT_CFM_FUNCTION SRContinueRecognition
  396.     ENDIF
  397.  
  398. ;
  399. ; pascal OSErr SRCancelRecognition(SRRecognizer recognizer)
  400. ;
  401.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  402.         Macro
  403.         _SRCancelRecognition
  404.             move.w              #$0211,D0
  405.             dc.w                $AA56
  406.         EndM
  407.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  408.         IMPORT_CFM_FUNCTION SRCancelRecognition
  409.     ENDIF
  410.  
  411. ;
  412. ; pascal OSErr SRIdle(void )
  413. ;
  414.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  415.         Macro
  416.         _SRIdle
  417.             move.w              #$0028,D0
  418.             dc.w                $AA56
  419.         EndM
  420.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  421.         IMPORT_CFM_FUNCTION SRIdle
  422.     ENDIF
  423.  
  424. ;  Language Model Building and Manipulation Functions 
  425. ;
  426. ; pascal OSErr SRNewLanguageModel(SRRecognitionSystem system, SRLanguageModel *model, const void *name, Size nameLength)
  427. ;
  428.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  429.         Macro
  430.         _SRNewLanguageModel
  431.             move.w              #$0812,D0
  432.             dc.w                $AA56
  433.         EndM
  434.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  435.         IMPORT_CFM_FUNCTION SRNewLanguageModel
  436.     ENDIF
  437.  
  438. ;
  439. ; pascal OSErr SRNewPath(SRRecognitionSystem system, SRPath *path)
  440. ;
  441.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  442.         Macro
  443.         _SRNewPath
  444.             move.w              #$0413,D0
  445.             dc.w                $AA56
  446.         EndM
  447.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  448.         IMPORT_CFM_FUNCTION SRNewPath
  449.     ENDIF
  450.  
  451. ;
  452. ; pascal OSErr SRNewPhrase(SRRecognitionSystem system, SRPhrase *phrase, const void *text, Size textLength)
  453. ;
  454.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  455.         Macro
  456.         _SRNewPhrase
  457.             move.w              #$0814,D0
  458.             dc.w                $AA56
  459.         EndM
  460.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  461.         IMPORT_CFM_FUNCTION SRNewPhrase
  462.     ENDIF
  463.  
  464. ;
  465. ; pascal OSErr SRNewWord(SRRecognitionSystem system, SRWord *word, const void *text, Size textLength)
  466. ;
  467.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  468.         Macro
  469.         _SRNewWord
  470.             move.w              #$0815,D0
  471.             dc.w                $AA56
  472.         EndM
  473.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  474.         IMPORT_CFM_FUNCTION SRNewWord
  475.     ENDIF
  476.  
  477. ;  Operations on any object of the SRLanguageObject family 
  478. ;
  479. ; pascal OSErr SRPutLanguageObjectIntoHandle(SRLanguageObject languageObject, Handle lobjHandle)
  480. ;
  481.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  482.         Macro
  483.         _SRPutLanguageObjectIntoHandle
  484.             move.w              #$0416,D0
  485.             dc.w                $AA56
  486.         EndM
  487.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  488.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoHandle
  489.     ENDIF
  490.  
  491. ;
  492. ; pascal OSErr SRPutLanguageObjectIntoDataFile(SRLanguageObject languageObject, short fRefNum)
  493. ;
  494.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  495.         Macro
  496.         _SRPutLanguageObjectIntoDataFile
  497.             move.w              #$0328,D0
  498.             dc.w                $AA56
  499.         EndM
  500.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  501.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoDataFile
  502.     ENDIF
  503.  
  504. ;
  505. ; pascal OSErr SRNewLanguageObjectFromHandle(SRRecognitionSystem system, SRLanguageObject *languageObject, Handle lObjHandle)
  506. ;
  507.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  508.         Macro
  509.         _SRNewLanguageObjectFromHandle
  510.             move.w              #$0417,D0
  511.             dc.w                $AA56
  512.         EndM
  513.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  514.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromHandle
  515.     ENDIF
  516.  
  517. ;
  518. ; pascal OSErr SRNewLanguageObjectFromDataFile(SRRecognitionSystem system, SRLanguageObject *languageObject, short fRefNum)
  519. ;
  520.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  521.         Macro
  522.         _SRNewLanguageObjectFromDataFile
  523.             move.w              #$0427,D0
  524.             dc.w                $AA56
  525.         EndM
  526.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  527.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromDataFile
  528.     ENDIF
  529.  
  530. ;
  531. ; pascal OSErr SREmptyLanguageObject(SRLanguageObject languageObject)
  532. ;
  533.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  534.         Macro
  535.         _SREmptyLanguageObject
  536.             move.w              #$0218,D0
  537.             dc.w                $AA56
  538.         EndM
  539.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  540.         IMPORT_CFM_FUNCTION SREmptyLanguageObject
  541.     ENDIF
  542.  
  543. ;
  544. ; pascal OSErr SRChangeLanguageObject(SRLanguageObject languageObject, const void *text, Size textLength)
  545. ;
  546.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  547.         Macro
  548.         _SRChangeLanguageObject
  549.             move.w              #$0619,D0
  550.             dc.w                $AA56
  551.         EndM
  552.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  553.         IMPORT_CFM_FUNCTION SRChangeLanguageObject
  554.     ENDIF
  555.  
  556. ;
  557. ; pascal OSErr SRAddLanguageObject(SRLanguageObject base, SRLanguageObject addon)
  558. ;
  559.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  560.         Macro
  561.         _SRAddLanguageObject
  562.             move.w              #$041A,D0
  563.             dc.w                $AA56
  564.         EndM
  565.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  566.         IMPORT_CFM_FUNCTION SRAddLanguageObject
  567.     ENDIF
  568.  
  569. ;
  570. ; pascal OSErr SRAddText(SRLanguageObject base, const void *text, Size textLength, long refCon)
  571. ;
  572.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  573.         Macro
  574.         _SRAddText
  575.             move.w              #$081B,D0
  576.             dc.w                $AA56
  577.         EndM
  578.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  579.         IMPORT_CFM_FUNCTION SRAddText
  580.     ENDIF
  581.  
  582. ;
  583. ; pascal OSErr SRRemoveLanguageObject(SRLanguageObject base, SRLanguageObject toRemove)
  584. ;
  585.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  586.         Macro
  587.         _SRRemoveLanguageObject
  588.             move.w              #$041C,D0
  589.             dc.w                $AA56
  590.         EndM
  591.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  592.         IMPORT_CFM_FUNCTION SRRemoveLanguageObject
  593.     ENDIF
  594.  
  595. ;  Traversing SRRecognitionResults or SRLanguageObjects 
  596. ;
  597. ; pascal OSErr SRCountItems(SRSpeechObject container, long *count)
  598. ;
  599.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  600.         Macro
  601.         _SRCountItems
  602.             move.w              #$0405,D0
  603.             dc.w                $AA56
  604.         EndM
  605.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  606.         IMPORT_CFM_FUNCTION SRCountItems
  607.     ENDIF
  608.  
  609. ;
  610. ; pascal OSErr SRGetIndexedItem(SRSpeechObject container, SRSpeechObject *item, long index)
  611. ;
  612.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  613.         Macro
  614.         _SRGetIndexedItem
  615.             move.w              #$0606,D0
  616.             dc.w                $AA56
  617.         EndM
  618.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  619.         IMPORT_CFM_FUNCTION SRGetIndexedItem
  620.     ENDIF
  621.  
  622. ;
  623. ; pascal OSErr SRSetIndexedItem(SRSpeechObject container, SRSpeechObject item, long index)
  624. ;
  625.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  626.         Macro
  627.         _SRSetIndexedItem
  628.             move.w              #$0607,D0
  629.             dc.w                $AA56
  630.         EndM
  631.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  632.         IMPORT_CFM_FUNCTION SRSetIndexedItem
  633.     ENDIF
  634.  
  635. ;
  636. ; pascal OSErr SRRemoveIndexedItem(SRSpeechObject container, long index)
  637. ;
  638.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  639.         Macro
  640.         _SRRemoveIndexedItem
  641.             move.w              #$0408,D0
  642.             dc.w                $AA56
  643.         EndM
  644.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  645.         IMPORT_CFM_FUNCTION SRRemoveIndexedItem
  646.     ENDIF
  647.  
  648. ;  Utilizing the System Feedback Window 
  649. ;
  650. ; pascal OSErr SRDrawText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  651. ;
  652.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  653.         Macro
  654.         _SRDrawText
  655.             move.w              #$0621,D0
  656.             dc.w                $AA56
  657.         EndM
  658.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  659.         IMPORT_CFM_FUNCTION SRDrawText
  660.     ENDIF
  661.  
  662. ;
  663. ; pascal OSErr SRDrawRecognizedText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  664. ;
  665.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  666.         Macro
  667.         _SRDrawRecognizedText
  668.             move.w              #$0622,D0
  669.             dc.w                $AA56
  670.         EndM
  671.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  672.         IMPORT_CFM_FUNCTION SRDrawRecognizedText
  673.     ENDIF
  674.  
  675. ;
  676. ; pascal OSErr SRSpeakText(SRRecognizer recognizer, const void *speakText, Size speakLength)
  677. ;
  678.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  679.         Macro
  680.         _SRSpeakText
  681.             move.w              #$0620,D0
  682.             dc.w                $AA56
  683.         EndM
  684.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  685.         IMPORT_CFM_FUNCTION SRSpeakText
  686.     ENDIF
  687.  
  688. ;
  689. ; pascal OSErr SRSpeakAndDrawText(SRRecognizer recognizer, const void *text, Size textLength)
  690. ;
  691.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  692.         Macro
  693.         _SRSpeakAndDrawText
  694.             move.w              #$061F,D0
  695.             dc.w                $AA56
  696.         EndM
  697.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  698.         IMPORT_CFM_FUNCTION SRSpeakAndDrawText
  699.     ENDIF
  700.  
  701. ;
  702. ; pascal OSErr SRStopSpeech(SRRecognizer recognizer)
  703. ;
  704.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  705.         Macro
  706.         _SRStopSpeech
  707.             move.w              #$0223,D0
  708.             dc.w                $AA56
  709.         EndM
  710.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  711.         IMPORT_CFM_FUNCTION SRStopSpeech
  712.     ENDIF
  713.  
  714. ;
  715. ; pascal Boolean SRSpeechBusy(SRRecognizer recognizer)
  716. ;
  717.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  718.         Macro
  719.         _SRSpeechBusy
  720.             move.w              #$0224,D0
  721.             dc.w                $AA56
  722.         EndM
  723.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  724.         IMPORT_CFM_FUNCTION SRSpeechBusy
  725.     ENDIF
  726.  
  727. ;
  728. ; pascal OSErr SRProcessBegin(SRRecognizer recognizer, Boolean failed)
  729. ;
  730.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  731.         Macro
  732.         _SRProcessBegin
  733.             move.w              #$031D,D0
  734.             dc.w                $AA56
  735.         EndM
  736.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  737.         IMPORT_CFM_FUNCTION SRProcessBegin
  738.     ENDIF
  739.  
  740. ;
  741. ; pascal OSErr SRProcessEnd(SRRecognizer recognizer, Boolean failed)
  742. ;
  743.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  744.         Macro
  745.         _SRProcessEnd
  746.             move.w              #$031E,D0
  747.             dc.w                $AA56
  748.         EndM
  749.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  750.         IMPORT_CFM_FUNCTION SRProcessEnd
  751.     ENDIF
  752.  
  753.  
  754.  
  755.     ENDIF ; __SPEECHRECOGNITION__ 
  756.  
  757.